<?php

namespace GamesBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @author  coffey  <coffey@nligo.com>
 * GamesSpec
 *
 * 游戏规格
 *
 * @ORM\Table(name="games_spec")
 * @ORM\Entity(repositoryClass="GamesBundle\Repository\GamesSpecRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class GamesSpec
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer", nullable=false,options={"comment":"规格自增ID"})
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="spec_sign", type="string", length=120, nullable=false,options={"comment":"规则符号"})
     */
    private $specSign = '';

    /**
     * @var integer
     *
     * @ORM\Column(name="spec_bit", type="integer",nullable=false,options={"comment":"规格位数"})
     */
    private $specBit = '0';

    /**
     * @ORM\ManyToOne(targetEntity="Games")
     * @ORM\JoinColumn(name="game_id", referencedColumnName="id")
     */
    private $gameId;


    /**
     * @var string
     *
     * @ORM\Column(name="first_filed_def", type="string", length=30, nullable=false,options={"comment":"传递两个参数时候，1/3.  此时该值为默认下注的名词"})
     */
    private $firstFiledDef = '1';

    /**
     * @var integer
     *
     * @ORM\Column(name="create_at", type="integer", nullable=false,options={"comment":"创建时间"})
     */
    private $createAt = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="update_at", type="integer", nullable=false,options={"comment":"更新时间"})
     */
    private $updateAt = '0';

    /**
     * @ORM\PrePersist
     */
    public function PrePersist(){
        $this->setCreateAt(time());
        $this->setUpdateAt(time());
    }

    /**
     * @ORM\PreUpdate
     */
    public function PreUpdate(){
        $this->setCreateAt(time());
    }


    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set specSign
     *
     * @param string $specSign
     *
     * @return GamesSpec
     */
    public function setSpecSign($specSign)
    {
        $this->specSign = $specSign;

        return $this;
    }

    /**
     * Get specSign
     *
     * @return string
     */
    public function getSpecSign()
    {
        return $this->specSign;
    }

    /**
     * Set specBit
     *
     * @param integer $specBit
     *
     * @return GamesSpec
     */
    public function setSpecBit($specBit)
    {
        $this->specBit = $specBit;

        return $this;
    }

    /**
     * Get specBit
     *
     * @return integer
     */
    public function getSpecBit()
    {
        return $this->specBit;
    }

    /**
     * Set firstFiledDef
     *
     * @param string $firstFiledDef
     *
     * @return GamesSpec
     */
    public function setFirstFiledDef($firstFiledDef)
    {
        $this->firstFiledDef = $firstFiledDef;

        return $this;
    }

    /**
     * Get firstFiledDef
     *
     * @return string
     */
    public function getFirstFiledDef()
    {
        return $this->firstFiledDef;
    }

    /**
     * Set createAt
     *
     * @param integer $createAt
     *
     * @return GamesSpec
     */
    public function setCreateAt($createAt)
    {
        $this->createAt = $createAt;

        return $this;
    }

    /**
     * Get createAt
     *
     * @return integer
     */
    public function getCreateAt()
    {
        return $this->createAt;
    }

    /**
     * Set updateAt
     *
     * @param integer $updateAt
     *
     * @return GamesSpec
     */
    public function setUpdateAt($updateAt)
    {
        $this->updateAt = $updateAt;

        return $this;
    }

    /**
     * Get updateAt
     *
     * @return integer
     */
    public function getUpdateAt()
    {
        return $this->updateAt;
    }

    /**
     * Set gameId
     *
     * @param \GamesBundle\Entity\Games $gameId
     *
     * @return GamesSpec
     */
    public function setGameId(\GamesBundle\Entity\Games $gameId = null)
    {
        $this->gameId = $gameId;

        return $this;
    }

    /**
     * Get gameId
     *
     * @return \GamesBundle\Entity\Games
     */
    public function getGameId()
    {
        return $this->gameId;
    }
}
